#include "display.h"
ALLEGRO_TRANSFORM *Init_trans(ALLEGRO_DISPLAY* d){
    ALLEGRO_TRANSFORM *t = malloc(sizeof(ALLEGRO_TRANSFORM));
    const float scale_factor_x = ((float)al_get_display_width(d)) / SCALED_WIDTH;
	const float scale_factor_y = ((float)al_get_display_height(d)) / SCALED_HEIGHT;
    al_identity_transform(t);
	al_scale_transform(t, scale_factor_x, scale_factor_y);
	al_use_transform(t);
    return t;
}

ALLEGRO_DISPLAY* Init_display(){
    ALLEGRO_DISPLAY *d = NULL;
    al_set_new_display_flags(ALLEGRO_FULLSCREEN_WINDOW);
    d = al_create_display(SCALED_WIDTH, SCALED_HEIGHT);
    if (!d) {
		fprintf(stderr, "Cannot create allegro display!");
		return NULL;
	}
    return d;
}